Skip to content

[Docs+] Build a Newsletter Platform With Flask and MongoDB #267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

rachel-mack
Copy link
Collaborator

@rachel-mack rachel-mack commented May 14, 2025

Pull Request Info

PR Reviewing Guidelines
Original blog post - https://www.mongodb.com/developer/products/mongodb/python-flask-celery-newsletter/

JIRA - https://jira.mongodb.org/browse/DOCSP-48899

Staging Links

  • integrations/flask-celery-integration
  • integrations
  • Self-Review Checklist

    • Is this free of any warnings or errors in the RST?
    • Did you run a spell-check?
    • Did you run a grammar-check?
    • Are all the links working?
    • Are the facets and meta keywords accurate?
    • Are the page titles greater than 20 characters long and SEO relevant?

    Copy link

    netlify bot commented May 14, 2025

    Deploy Preview for docs-pymongo ready!

    Name Link
    🔨 Latest commit 0aac3a1
    🔍 Latest deploy log https://app.netlify.com/projects/docs-pymongo/deploys/6841c02b91fee400083788a3
    😎 Deploy Preview https://deploy-preview-267--docs-pymongo.netlify.app
    📱 Preview on mobile
    Toggle QR Code...

    QR Code

    Use your smartphone camera to open QR code link.

    To edit notification comments on pull requests, go to your Netlify project configuration.

    @rachel-mack rachel-mack marked this pull request as ready for review May 27, 2025 17:58
    Copy link
    Collaborator

    @mongoKart mongoKart left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    great work on a long page!

    @@ -0,0 +1,561 @@
    .. _pymongo-flask-celery:
    .. original URL: https://www.mongodb.com/developer/products/mongodb/python-flask-celery-newsletter/
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    were we asked to doc the original URL like this?

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    It's part of a proposed maintenance plan. The idea is to compare traffic to the new url compared with traffic to the new url, and this will help track that.

    :values: tutorial

    .. meta::
    :keywords: flask, celery, integration, code example
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    any other keywords that make sense here? 'flask', 'celery', and 'integration' are in page headings and therefore get a lot of weight already

    Comment on lines 24 to 25
    In this tutorial, you can learn how to build a newsletter platform using
    MongoDB, Celery, and Flask. This application allows users to subscribe to
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I: using

    Suggested change
    In this tutorial, you can learn how to build a newsletter platform using
    MongoDB, Celery, and Flask. This application allows users to subscribe to
    In this tutorial, you can learn how to build a newsletter platform by using
    MongoDB, Celery, and Flask. This application allows users to subscribe to

    Or:

    Suggested change
    In this tutorial, you can learn how to build a newsletter platform using
    MongoDB, Celery, and Flask. This application allows users to subscribe to
    In this tutorial, you can learn how to use MongoDB, Celery, and Flask
    to build a newsletter platform. This application allows users to subscribe to

    Comment on lines 31 to 32
    Celery is an open-source distributed task queue that makes handling large
    volumes of messages efficiently. It supports asynchronous processing and task
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    Celery is an open-source distributed task queue that makes handling large
    volumes of messages efficiently. It supports asynchronous processing and task
    Celery is an open-source distributed task queue that makes handling large
    volumes of messages efficient. It supports asynchronous processing and task

    Or:

    Suggested change
    Celery is an open-source distributed task queue that makes handling large
    volumes of messages efficiently. It supports asynchronous processing and task
    Celery is an open-source distributed task queue that handles large
    volumes of messages efficiently. It supports asynchronous processing and task

    Prerequisites
    ~~~~~~~~~~~~~

    Ensure you have the following components installed and set up before you start
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I: relative pronoun

    Suggested change
    Ensure you have the following components installed and set up before you start
    Ensure that you have the following components installed and set up before you start

    Comment on lines 539 to 540
    You can also confirm that you sent an email navigating to the
    ``deliveries`` collection in your ``newletter`` database.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    You can also confirm that you sent an email navigating to the
    ``deliveries`` collection in your ``newletter`` database.
    You can also confirm that you sent an email by navigating to the
    ``deliveries`` collection in your ``newsletter`` database.

    Comment on lines 545 to 546
    This application demonstrates how to integrate with the Celery tasks task queue to
    manage subscriber data, and send batch emails. You can further enhance this
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    This application demonstrates how to integrate with the Celery tasks task queue to
    manage subscriber data, and send batch emails. You can further enhance this
    This application demonstrates how to integrate with the Celery task queue to
    manage subscriber data and send batch emails. You can further enhance this

    More Resources
    --------------

    For more information about to components used in this tutorial, see the following
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    For more information about to components used in this tutorial, see the following
    For more information about the components used in this tutorial, see the following

    Comment on lines 556 to 559
    - `Flask <https://flask.palletsprojects.com>`__
    - `Flask Mail <https://pypi.org/project/Flask-Mail/#files>`__
    - `Celery <https://docs.celeryq.dev/en/stable/>`__
    - :mdb-shell:`MongoDB Shell <>`
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: i think you could omit links already included earlier in the page

    Copy link
    Collaborator Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I think there's value in having links available through the docs and then also at the end. Then you're providing access as the links are relevant, but also in an easy to find location for quick reference.

    - `Celery <https://docs.celeryq.dev/en/stable/>`__
    - :mdb-shell:`MongoDB Shell <>`

    For support or to contribute to the MongoDB Community, see the `MongoDB Developer Community <https://www.mongodb.com/community/>`__.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    S: clarity

    Suggested change
    For support or to contribute to the MongoDB Community, see the `MongoDB Developer Community <https://www.mongodb.com/community/>`__.
    To find support or to contribute to the MongoDB community, see the `MongoDB Developer Community <https://www.mongodb.com/community/>`__ page.

    @rachel-mack rachel-mack requested a review from mongoKart June 4, 2025 20:19
    Copy link
    Collaborator

    @mongoKart mongoKart left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Looks great! Just a couple small suggestions

    :atlas:`Get Started with Atlas </getting-started?tck=docs_driver_python>` page
    in the Atlas documentation.
    - A database in your cluster called ``newsletter``. For more information, see
    - A database names ``newsletter`` in your cluster. For more information, see
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    - A database names ``newsletter`` in your cluster. For more information, see
    - A database named ``newsletter`` in your cluster. For more information, see

    Comment on lines 66 to 67
    SMTP servers, see the `Simple Mail Transfer Protocol
    <https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol>`__ wikipedia page.
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    SMTP servers, see the `Simple Mail Transfer Protocol
    <https://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol>`__ wikipedia page.
    SMTP servers, see the :wikipedia:`Simple Mail Transfer Protocol
    <Simple_Mail_Transfer_Protocol>`__ Wikipedia page.

    Comment on lines 281 to 282
    following files use `Fetch API calls
    <https://en.wikipedia.org/wiki/XMLHttpRequest#Fetch_alternative>`__. They also
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Suggested change
    following files use `Fetch API calls
    <https://en.wikipedia.org/wiki/XMLHttpRequest#Fetch_alternative>`__. They also
    following files use :wikipedia:`Fetch API calls
    <XMLHttpRequest#Fetch_alternative>`__. They also

    @@ -330,10 +341,11 @@ Copy the following code into your ``subscribe.html`` file:
    </body>
    </html>

    Because this application uses asynchronous messages, the script in this file
    uses Fetch API calls. This script also handles timeouts and errors.
    The script for the admin page displays an alert to the user which depends on the
    Copy link
    Collaborator

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    that/which

    Suggested change
    The script for the admin page displays an alert to the user which depends on the
    The script for the admin page displays an alert to the user that depends on the

    - `Gmail <www.gmail.com>`__ to use as an SMTP server. For more information about
    SMTP servers, see the :wikipedia:`Simple Mail Transfer Protocol
    <Simple_Mail_Transfer_Protocol>` Wikipedia page.
    - `Python 3.8 or later <https://www.python.org/downloads/>`__
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I'd recommend 3.9 or later, since 3.8 is end of life and the current version of PyMongo only supports 3.9+.


    .. code-block:: bash

    pip install Flask Flask-Mail pymongo celery
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    I'd recommend using flask-pymongo since we maintain it.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants